home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
os2
/
epmgcc10.zip
/
INSTALL.DOC
< prev
next >
Wrap
Text File
|
1994-01-28
|
16KB
|
339 lines
EMX/GCC Interface to EPM 5.51
EPMGCC Version 1.00
Bernhard Bablok
January, 1994
Legal stuff:
~~~~~~~~~~~
See the file license.txt.
Requirements:
~~~~~~~~~~~~
The EMX/GCC interface to EPM supplied with this package needs to be compiled
before it can be incorporated into EPM. You will need to obtain the complete
EPM 5.51 package from IBM to do this.
The EPM package is available for free from the following Internet sites:
software.watson.ibm.com /pub/os2/os2fixes
ftp-os2.nmsu.edu /pub/os2/ibm/os2fixes
It should also be available from major OS/2 BBS services.
Note: With OS2 2.1, EPM 5.51 is part of OS2. You still need to obtain the
complete package, since you need the source code of the standard set of
e-macros.
Introduction:
~~~~~~~~~~~~
(Skip this section if you are familiar with configuring and compiling EPM).
To understand how the menu and function key support for EMX/GCC is implemented,
one has to understand how IBM's Enhanced Editor EPM works. EPM consists of one
exe-file (EPM.EXE) and a few "ex"-files, normaly at least "epm.ex" and
"extra.ex". EPM.EXE supplies the PM-interface (eg. message-queue), while the
ex-files implement the functionality of the editor via compiled macros. Each
ex-file is called a module and consists of definitions of editor commands,
internal procedures, menus, keys and so on. These definitions are written in a
macro language called "E", which is similar but not identical to REXX. The
source files have the extension "e".
Each module is the result of a compilation process of a source file. It is
possible to include other source files in a sort of "master source file".
Normally, the whole set of standard macros are compiled into two modules, epm.ex
and extra.ex. The reason for this is that a module is limited in size to 64k.
These two modules are loaded at startup of the editor. Additional modules can be
loaded later.
Including source files into a master source file allows not only for an easier
maintenance of code, but allows the inclusion of files depending on
configuration constants (similar to #ifdef #include ... #endif structures in C).
Configuring EPM and adding own applications is made very simple through a trick.
The standard set of E-macros include a number of MY*.E files. These files are
the only ones which have to be changed. Once the MY*.E files are set up, only
epm.e and extra.e have to be recompiled and the modules have to be located in a
place where the editor can find them.
The following sections deal with the installation of EPM 5.51 and the
modifications necessary on the MY*.E files to install EPMGCC.
Installation of EPM 5.51:
~~~~~~~~~~~~~~~~~~~~~~~~
Note: This section is taken from the install.doc file of EPMTEX13, written by
Jon Hacker. If you are using TeX, I recommend this package - it adds
menu support to EPM to be used with TeX. Without this package, I would
have probably not succeeded in writing EPMGCC. The package is
available for free from various ftp-sites.
If you are not already familiar with compiling EPM macros on your machine, read
this section for additional help.
The installation of the EPM 5.51 package is sufficiently confusing that I will
try to give some hints to get you going as fast as possible.
The EPM package includes two hypertext files; the EPM User's Manual, and the EPM
Technical Reference. Both of these manuals provide a wealth of information on
EPM. It is highly recommended that you spend some time becoming familiar with
EPM, and the E macro language by reading through them.
1) Decide on a location for your EPM files. I suggest something like
\os2\epm or \epm. I would avoid using the \os2\apps directory
where the binaries for EPM 5.50 are placed in the GA release of OS/2 2.0.
There's just too much other crap in there already.
2) Unzip the EPM 5.51 files. You will want to take care where you put
everything. I recommend the following directory structure as suggested in
the EPMBBS.TXT file in the EPM package from IBM.
EPMAPP.ZIP - Unzip into your epm directory (eg \os2\epm)
EPM.EXE - The 5.51 version of the editor
ETPM.EXE - The 5.51 version of the macro compiler
PMMORE.EXE - Useful for debugging Rexx macros; entering RXSHELL from
EPM will start PMMORE and redirect STDOUT to this window.
SAY and TRACE output will be displayed there.
*.EX - the 5.51 version of the compiled macros
EPMHELP.QHL - the updated "quick help" file
EPMTECH.NDX - An index file for getting macro programmer help.
EPMBK.ZIP - Unpack into a directory in your BOOKSHELF path
EPMUSERS.INF - The EPM User's Guide
EPMTECH.INF - The EPM Macro Programmer's Technical Reference
EPMDLL.ZIP - Unpack into \os2\apps\dll or a directory in your LIBPATH. Delete
the obsolete ETK*550.DLL files leftover from EPM 5.50.
ETK*551.DLL - The E Toolkit DLLs.
EPMMAC.ZIP - Create a subdirectory under EPM called E_MACROS and unzip into it.
*.e - contains the macro files used to build the standard *.ex files.
EPMHLP.ZIP - Updated EPM.HLP; unpack into \os2\help
EMPSMP.ZIP - Create a subdirectory under EPM called sampmacs and unzip this file
into it.
*.e - Sample E macro code; includes both useful programs and
building blocks that you can use in writing your own code.
EPMREX.ZIP - Create a subdirectory under EPM called EREXX, unzip this file into
it and add it to your EPMPATH.
*.erx - contains some sample EPM / Rexx macros.
EPMASI.ZIP - Create a subdirectory under EPM called myassist, unzip this file
into it and add it to your EPMPATH.
An alternative approach to syntax-assisted editing; makes it easy to
add your own expansions. Includes sample files for OS/2 and PM APIs,
C, and Bookmaster.
EPMATR.ZIP - Create a subdirectory under EPM called epmattr, unzip this file
into it and add it to your EPMPATH.
Sample code for doing things with EPM's attribute support.
3) Edit your config.sys file and make sure that your new epm directory
is included in you PATH statement. If you have IBM's TCP/IP networking
package, make sure your epm directory comes before \tcpip\bin in your PATH,
or delete the redundant EPM files as outlined in step (6).
4) Edit your config.sys file and make sure that the e_macros, sampmacs,
erexx, myassist, and epmattr subdirectories are included in your EPMPATH.
EPMPATH is used by the ETPM compiler to find macro files that are not in your
current directory.
5) Use a file finding utility to hunt down all *.ex files. These are
the compiled E macros that EPM executes. The GA release of OS/2 puts them
in \os2\apps. Delete all redundant or older *.ex files on your system. You
only need them in your EPM directory. Having multiple copies of the *.ex
files may result in strange behaviour from EPM.
----- OPTIONAL -------------------------------------------------------------
6) If you have IBM's TCP/IP networking package, there will be some more *.ex
files in \tcpip\bin. You can delete most of these files, or, if you prefer,
just make sure your your epm directory comes before \tcpip\bin in your PATH,
WARNING: LEAVE THE FOLLOWING UNIQUE TO LAMAIL *.EX FILES IN \TCPIP\BIN
~~~~~~
EPMLIST.EX
LAMEXTRA.EX
MAILLIST.EX
-----------------------------------------------------------------------------
7) Find all copies of EPM.EXE (v 5.50) and delete them. Likely hiding places
are \os2\apps and \tcpip\bin. You only need the one copy of epm.exe and it
should be in your epm directory. As long as it is in your PATH lamail will
find it.
8) Find all copies of ETK*550.DLL (v 5.50 dll's) and delete them. Likely
hiding places are \os2\apps\dll and \tcpip\dll. You only need the v5.51
dll's and they should be put somewhere in your LIBPATH (\os2\apps\dll is as
good as any) As long as it is in your LIBPATH lamail will find it.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTE: Unfortunately, when you apply a CSD or Service Pack, copies of
EPM will again be placed in \os2\apps or \tcpip\bin and you will need
to do some housekeeping to get things back in order.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9) I advise you get the spell checker option EPM_SPEL.ZIP for EPM. It is a
nice thing to have and is available from the following INTERNET source.
ftp-os2.nmsu.edu /pub/os2/2.0/editors
You will need to put the location of the dictionary (us.dct file) in the
paths section of the EPM preferences notebook. I put mine in
\os2\dictionary.
10) You should now be ready to compile your E macros. First, though, reboot
if you made any changes to config.sys.
Configuring the editor:
~~~~~~~~~~~~~~~~~~~~~~
"Configuring the editor" means the definition of constants which define the
behavior of the editor like colors, appearance of the mouse, mark-mode and (very
important!) which macros of the standard set are included into the two
base-modules epm.ex and extra.ex. Configuring is not only important to make EPM
look and act like you expect it to do, but also to save space. For example, I
have thrown out all macros which implement the host support, since my PC is not
connected to a host. Space is needed for additional applications and to minimize
startup time of the editor.
Configuration is done by setting up a file called MYCNF.E. This file is included
by various e-macro source file to alter the code at compile time.
Read the section in the EPM user's manual 'Changing the default configuration'
to understand the use of EPM's configuration constants and what they can do.
The binaries included with the EPM package were compiled with the constants
defined in epmgcnf.smp in your e_macros subdirectory. If these are OK with you,
copy epmgcnf.smp to a file called mycnf.e in your e_macros directory. I have
also included a file MYCNF.SMP as an example of a configuration file (it is the
one I use).
Important note: Never put any executable e-code in MYCNF.E!
Implementing EPMGCC:
~~~~~~~~~~~~~~~~~~~
Any additional applications should be implemented via the MY*.E files. They are
included automatically at the right place. The following files are supplied as
samples (extension "smp" instead as "e"):
MYKEYS.E This file should include application key definitions. It is better
to use "TRYINCLUDE" statements, so you don't have to change this
file if a new version of an application is to be used. The sample
file consists of a single statement:
TRYINCLUDE 'gcckeys.e'.
The included file defines some accelerator keys and the
"next-error-key". If the defined keys conflict with key definitions
of other applications, you would have to edit gcckeys.e.
MYSTUFF.E All includes for application macros which should go into the module
epm.ex. Note that the size of epm.ex is limited to 64k. The sample
file consists of two statements (since I also use EPMTEX13):
TRYINCLUDE 'tex.e'
TRYINCLUDE 'gcc.e'
If you do not have EPMTEX13, you do not have to remove the first
line - it is ignored by the macro compiler.
MYMNUINI.E This file is included by the standard macro which implements the
menu support. If applications need menu support, their code should
be included into this file. Again, the sample consists of two
statements:
TRYINCLUDE 'texmenu.e'
TRYINCLUDE 'gccmenu.e'
Note to EPMTEX13 users: I have renamed the file mymnuini.e supplied
with EPMTEX13 to texmenu.e.
Important note: The set of internal procedures and command definitions used by
EPMGCC is not part of epm.ex due to size limitations. The file
gccproc.e has to be compiled seperately (see below). The
resulting module is loaded automatically after startup of the
editor.
Configuring EPMGCC:
~~~~~~~~~~~~~~~~~~
EPMGCC offers two levels of configuration. You can define the utilities
(compiler, make, debugger) which are invoked by the various menu-selections.
These definitions cannot be changed after the compilation of the edit-macros.
In addition you can define startup values for the compile/build-options and for
the debug, autosave and verbose toggles. These values can be changed at runtime
but they cannot be saved from session to session.
Configuration is done in a file called GCCENV.E. The main idea is that you don't
have to change the configuration file when a new version of EPMGCC becomes
available.
The file gccenv.smp reproduces the defaults used if no gccenv.e file is found.
Take a look at gccenv.smp and decide if you have to change the defaults. If you
don't use EMX, you will most probably have to change the name of the debugger,
if your make-utility has a different name than "make" you will also have to
change the appropriate constant.
Note that editing gccenv.smp is not enough, EPMGCC needs a file called gccenv.e!
Compiling the macros:
~~~~~~~~~~~~~~~~~~~~
First, switch to your epm directory. If it makes you feel comfortable, make a
backup copies of epm.ex and extra.ex. Then issue the following commands:
etpm epm /V
etpm extra /V
etpm gccproc /V
The /V-switch shows all macro source files included in the module. ETPM will
complain about all errors with line and column number. If all your paths are set
up correctly and if MYCNF.E doesn't contain errors, there should be no errors
reported.
You should now be ready to use EPMGCC. For a test, start the editor, load a
c-source file into the edit-ring, edit it to include errors and press c-F12 (or
use the drop-down menu). After gcc has finished, press a-q once (this takes you
to the error-file) and after examining the errors press a-q again. This takes
you to the first error. Repeat pressing a-q to take you from error to error. At
any time, you can switch to the current error-file with the menu-selection "View
results" (there might be more than one error-file with the same name in the
edit-ring). If you want to go to a specific error, put the cursor on the line
reporting the error and press a-q.
Final notes:
~~~~~~~~~~~
In general, it is not a good idea to change the source code of the standard
macros. But if you want to use the C syntax assist supplied with EPM also for
C++ source files with the extension ".cc", you have to change in the file
ckeys.e the following line (line 30 in my copy):
if load_ext='C' or load_ext='H' or ... or load_ext='SQC' then
to
if wordpos(load_ext,'C CC H CPP CXX SQC') > 0 then
or add "or load_ext='CC'".
I hope EPMGCC is of value for you. If you think you have found a genuine bug,
or would like to make suggestions, contributions, or enhancements to this code
please drop me a note. Since I have released this code without charge, I cannot
offer a warranty or customer support, but I will do my best within the limit of
available time.
English is not my native language. Nevertheless, I hope the documentation is
clear enough to be of use. Everybody is welcome to supply a corrected version if
you feel it makes things clearer.
1/28/94
Bernhard Bablok
D-82256 Fuerstenfeldbruck, Germany
INTERNET: ua302cb@sunmail.lrz-muenchen.de